import std.stdio;
import std.perf;
import std.process;

/+
class Timer
{
   static long getCount()
   {
      asm
      {	naked	;
         rdtsc	;
         ret	;
      }
   }

   long starttime;

   this() { starttime = getCount(); }

   ~this()
   {
      writefln("elapsed time = %s", getCount() - starttime);
   }
}
+/

class Timer
{
   PerformanceCounter counter;

   this() {
      counter = new PerformanceCounter ();
      counter.start ();
   }

   ~this()
   {
      counter.stop ();
      writefln("elapsed time = %s", counter.milliseconds);
   }
}

void main(char[][] args)
{
   /* No parameters passed to program.
    */
   if (args.length == 1) {
      return 0;
   }

   char[][] progargs;

   if (args.length > 1) {
      progargs = progargs[2..$];
   }

   scope t = new Timer();
   return spawnvp (P_WAIT, args[1], args[1..$]);
}
